<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //setInterval(函数,时间间隔)
        /*关闭定时器 
            关闭定时器:
                    let 变量名 = setInterval(函数,间隔时间)
                    clearInterval(变量名)
        */
        setInterval(function () {
            console.log("你好");
        }, 1000)
    </script>
</body>

</html>